1. Technical Field
The present invention relates to data processing systems and, in particular, to a data processing system having a user space for executing software in user mode and a kernel space for executing software in kernel mode, where the data processing system includes an interface between the user mode and the kernel mode such that an application residing in user space may access the interface. Still more particularly, the present invention relates to a method and system in a data processing system for dedicating a portion of main memory for use by an application residing in user space.
2. Description of the Related Art
Data processing systems typically include a computer which is capable of executing an operating system and user applications. The operating system is software that controls the execution of programs and that may provide services such as resource allocation, scheduling, input/output (I/O) control, and data management.
The operating system includes a kernel which is the part of the operating system which performs basic functions such as the allocation of hardware resources. Software executing in the kernel executes in kernel mode in the kernel space. Software code which executes in the kernel mode has direct access to memory, hardware, I/O, and memory management. Supervisory services are executed in kernel mode. Supervisory services control the execution of other routines. Supervisory services are also called executive services. These services are utilized to access hardware and to perform other services.
User applications do not execute in kernel mode. User applications execute in the user mode in user space. User applications use program interfaces to request system services. User applications have access to only their own address space. Software executing in user mode must use procedure calls in order to access other system resources. Software executing in user mode does not have direct access to memory, I/O, or memory management.
A user application will sometimes have critical file data which must be guaranteed fast access. The known methods for permitting a user application in user mode to access files do not provide guaranteed fast access.
Many modern computer systems include a virtual memory manager with demand paging used to juggle active data between main memory, which typically has fast access times, and disk storage, which typically has much slower access times. Active data may include executing code, data structures used by the executing code, and open files. Paging is required to support virtual memories and file sizes that exceed the physical memory in the computer.
A page fault occurs when a program attempts to read data from a memory page that has been swapped out to disk. Page faults are very expensive from a performance point of view.
Some modern computers also support the pinning of main memory from kernel space. When the memory is pinned, it is not paged and therefore, not subject to the performance degradation which occurs as a result of a page fault. In these systems, memory is pinned only from the kernel space. Typically, memory is pinned only when critical sections of code or data exist where page faults cannot be tolerated. Pinning memory dedicates main memory, thus preventing the rest of the system from using this portion of the main memory. In systems which permit pinning of memory, a particular size of the memory is dedicated for use. However, this section of memory is not dedicated for a particular purpose, or for use by a particular file or for particular data.
Pinning memory is typically an extreme step because of the high cost of memory and the dire consequences to the system if no memory is available. Therefore, pinning memory is done infrequently, and only in the kernel mode.
Therefore a need exists for a method and system in a data processing system for permitting software in a user mode to pin memory for a particular purpose.